﻿using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace So.ImageResizer {
    public class Routes : IRouteProvider {
        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            foreach (var routeDescriptor in GetRoutes()) {
                routes.Add(routeDescriptor);
            }
        }

        public IEnumerable<RouteDescriptor> GetRoutes() {
            return new[] {
                /* Team */
                new RouteDescriptor {
                    Priority = 20,
                    Name = "ResizedImage",
                    Route = new Route("resizedImage",
                                      new RouteValueDictionary {
                                          {"area", "So.ImageResizer"},
                                          {"controller", "ImageResizer"},
                                          {"action", "ResizedImage"}
                                      },
                                      new RouteValueDictionary() {},
                                      new RouteValueDictionary {
                                          {"area", "So.ImageResizer"}
                                      },
                                      new MvcRouteHandler())
                }
            };
        }
    }
}